package com.bdqn.service;

import com.bdqn.entity.Article;
import com.bdqn.entity.ArticleCheck;
import com.bdqn.entity.ArticleWithBLOBs;
import com.bdqn.entity.UserWithBLOBs;
import com.bdqn.util.Page;
import com.bdqn.util.Result;
import org.springframework.web.multipart.commons.CommonsMultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.List;
import java.util.Map;

/**
 * 文章业务
 * @author mr_xian
 */
public interface ArticleService {

    /**
     * 流加载分页
     * @param tid
     * @param pageIndex
     * @param pageSize
     * @return
     */
    public Result<Page<Article>>  getPageArticles(Integer tid, Integer pageIndex,Integer pageSize);

    /**
     * 文章列表分页
     * @param timeRange
     * @param title
     * @param pageIndex
     * @param pageSize
     * @param session
     * @return
     */
    public  Result<Page<Article>>  getPageArticles1(String timeRange, String title, Integer type, Integer pageIndex, Integer pageSize, HttpSession session, boolean isDraft);

    /**
     * 微语分
     * @param pageIndex
     * @param pageSize
     * @param session
     * @param user
     * @return
     */
    public  Result<Page<Article>>  getPageWhisper(Integer pageIndex, Integer pageSize, HttpSession session, UserWithBLOBs user);

    public Map<String , Object> uploadArticleImg(HttpServletRequest request, CommonsMultipartFile file);


    public Result editArticle( String flag, ArticleWithBLOBs article,CommonsMultipartFile file ,HttpServletRequest request);

    public ArticleWithBLOBs getArticleByld(String uuid);

    public List<ArticleCheck> getArticleCheck (String uuid);


    public Result  updatePlusReader(String uuid);

}
